package max.t;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;

public class Ball 
{
private int x,y,radius,color;

private float xvel, yvel;

private Bitmap img;



public Ball(int x, int y, float xvel, float yvel, int color, int radius, Context context, int Drawable)

{
this.x = x;
this.y =y;
this.color = color;
this.xvel = xvel;
this.yvel = yvel;
this.radius = radius;
BitmapFactory.Options ops = new BitmapFactory.Options();
ops.inJustDecodeBounds = true;
img = BitmapFactory.decodeResource(context.getResources(),Drawable);


}

public Bitmap getImage()
{
	return img;
	
}
public void move(int gox, int goy, Ball otherBall)
{
	//System.out.println(img.getWidth());
	if(x<=0 || (x+ radius)>=450)
	{
		xvel = -xvel;
	}
	if(y<=0 || (y+radius)>=800)
	{
		yvel = -yvel;
	}
	
	x+=xvel;
	y+=yvel;
	
 //if((x+y)
}

public void setX(int x2)
{
 x =x2;	
}

public void setY(int y2)
{
y = y2;
}

public void setRadius(int radius2)
{
	radius = radius2;
}

public int getradius()
{
return radius;
}

public int gety()
{
	return y;
}

public int getx()
{ return x;
}

public void setxvel(float xvel2)
{
	 xvel = xvel2;
}
public float getxvel()
{
	return xvel;
}
public void setyvel(float yvel2)
{yvel = yvel2;
}

public float getyvel()
{
	return yvel;
}
public void setcolor(int color2)
{
	color = color2;
}

public int getcolor()
{
	return color;
}


}





